/*
 * File : spi_FM25V05.h
 *
 */

#ifndef __SPI_FM25V05_H_
#define __SPI_FM25V05_H_

#ifdef  __cplusplus
extern "C" {
#endif		/* __cplusplus */

/** @name SPI ERROR CODE DEFINE
 * @{
 */
#define SPI_SRAM_OK		0	///< Success
#define SPI_SRAM_ERR		1	///< Error:SRAM busy
/** @} */
extern void SPI_SRAM_Power_On(void);
extern void SPI_SRAM_Power_Off(void);

extern unsigned long SPI_SRAM_ReadID(void);
extern unsigned char SPI_SRAM_Page_Erase(unsigned long addr);
extern unsigned char SPI_SRAM_SubSector_Erase(unsigned long addr);
extern unsigned char SPI_SRAM_Sector_Erase(unsigned long addr);
extern unsigned char SPI_SRAM_Bulk_Erase(void);
extern unsigned char SPI_SRAM_Read(unsigned long addr,
									unsigned char *buf,
									unsigned short count);
extern unsigned char SPI_SRAM_Write(	unsigned long addr,
										unsigned char *buf,
										unsigned short count);
extern unsigned char SPI_SRAM_Fast_Write(	unsigned long addr,
											unsigned char *buf,
											unsigned short count);
extern unsigned char SPI_SRAM_Wait_Ready(void);
extern unsigned char SPI_SRAM_Init(unsigned long id);
extern void SPI_SRAM_Hook(void);
extern void SPI2_IRQ_CALLBACK(void);
void SPI_SRAM_DisadbleProtection(void);
void SPI_SRAM_PageErase(unsigned long PageAddr);
void SPI_SRAM_WaitForWriteEnd(void);

#ifdef __cplusplus
}
#endif	/* __cplusplus */
#endif	/* __SPI_FM25V05_H_ */
/** @} */